<template>
  <div class="throttle-page-container">
    <base-divide-title text="按钮节流"></base-divide-title>
    <div class="btn-throttle-wrap">
      <el-button @click="onBtnThrottle">测试节流</el-button>
    </div>
  </div>
</template>

<script>
import { throttle } from '@/utils/function';

export default {
  data() {
    return {};
  },
  methods: {
    onBtnThrottle: throttle(() => {
      console.log('throttle', new Date());
    }, 1000),
  },
};
</script>

<style lang="scss">
.throttle-page-container {
  width: 100%;
  height: 100%;

  .btn-throttle-wrap {
    padding: 20px;
  }
}
</style>
